package mercede.allBean;
import mercede.allDTOs.FlightDTO;
import mercede.allDTOs.HotelDTO;
import mercede.allManagers.FlightManager;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

@ManagedBean(name="flightbean")
@javax.faces.bean.SessionScoped

public class flightBean {
	
	@EJB
	FlightManager flightmgr;
	FlightDTO flightdto;
	

    
	private String city; 

      
	   
    public flightBean() {
    	flightdto = new FlightDTO();
    }
    
  

    public String getCity() {  
        return city;  
    }  
  
    public void setCity(String city) {  
        this.city = city;  
    }  
     

  public FlightDTO getFlightdto() {
         return flightdto;
 }
	 
	 public void setFlightdto(FlightDTO flightdto)
	 {
		 this.flightdto=flightdto;
	 }
 
 
 
public List<FlightDTO> getListFlightDTO(){
    return flightmgr.getListFlightDTO();
}

public List<?> getListgetFlight() {
    return  flightmgr.getFlight();
}

public List<FlightDTO> getListFlightDTOByDest()
{
	
	return flightmgr.getListFlightDTOByDest(city);
	}



public void  remove(int ddd){
	
	flightmgr.remove(ddd);
}

 

 public String register() {
	 flightmgr.save(flightdto);
         return "";
 }
	

}
